package javase.javase01.exercise02;

/**
 * @author: Gan
 * @date 2021/4/14 0014 21:57
 * @description:
 **/
public class MyThread extends Thread implements Runnable{
    public MyThread() {
    }

    public MyThread(String name) {
        super(name);
    }

    @Override
    public void run() {
        for (int i = 0; i < 20; i++) {
             System.out.println(Thread.currentThread().getName());
        }
        //获取线程名称
      /*  String name = getName();
        System.out.println(name);*/


    }
}
